<?php


namespace App\Http\Requests\Platform;

use App\Http\Requests\BaseRequest;

class AuthRuleRequest extends BaseRequest
{
    public $scenes=[
        'add'=>['pid','name','title'],
        'edit'=>['id','pid','name','title'],
    ];

    public function rules()
    {
        return [
            'id' => 'required|integer',
            'pid' => 'required|integer',
            'name' => 'required|between:2,15',
            'title' => 'required|between:2,10',
        ];
    }

    public function messages()
    {
        return [
            'id.required' => 'id不能为空',
            'id.integer' => 'id必须为整数',
            'pid.required' => 'pid不能为空',
            'pid.integer' => 'pid必须为整数',
            'name.required' => '路由名称不能为空',
            'name.between' => '路由名称长度在2~15之间',
            'title.required' => '权限名称不能为空',
            'title.between' => '权限名称名称长度在2~10之间',

        ];
    }






}
